import React, {Suspense, lazy} from 'react';
import {HashRouter as Router, Route, Switch, Redirect} from 'react-router-dom';
import './App.less';

const Home = lazy(() => import('@/pages/Home'));
const Preview = lazy(() => import('@/pages/Preview'));
const Login = lazy(() => import('@/pages/Login'));

export default function App() {
    return (
        <Router>
            <Suspense fallback={<div>loading</div>}>
                <Switch>
                    <Route exact path="/" component={Home} />
                    <Route  path="/preview" component={Preview} />
                    <Route exact path="/login" component={Login} />
                </Switch>
            </Suspense>
        </Router>
    );
}
